' π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅
' This program exported from BASIC Anywhere Machine (Version [5.2.3].[2023.10.26.02.14]) on 2023.11.01 at 02:28 (Coordinated Universal Time)
' Program by Charlie Veniot
' π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅π΅
'π π π Declarations π π π
DECLARE SUB π»PrintGhost(x%,y%)
ghostWidth% = 14
ghostHeight% = 14
ghostBod$ = _
".....XXXX....." + _
"...XXXXXXXX..." + _
"..XXXXXXXXXX.." + _
".XXXXXXXXXXXX." + _
".XXXXXXXXXXXX." + _
".XXXXXXXXXXXX." + _
"XXXXXXXXXXXXXX" + _
"XXXXXXXXXXXXXX" + _
"XXXXXXXXXXXXXX" + _
"XXXXXXXXXXXXXX" + _
"XXXXXXXXXXXXXX" + _
"XXXXXXXXXXXXXX" + _
"XX.XXX..XXX.XX" + _
"X...XX..XX...X"
ghostEyeballLeft$ = _
".............." + _
".............." + _
".............." + _
"..XX....XX...." + _
".XXXX..XXXX..." + _
"...XX....XX..." + _
"...XX....XX..." + _
"..XX....XX...." + STRING$(6*14,".")
ghostEyeballRight$ = _
".............." + _
".............." + _
".............." + _
"....XX....XX.." + _
"...XXXX..XXXX." + _
"...XX....XX..." + _
"...XX....XX..." + _
"....XX....XX.." + STRING$(6*14,".")
ghostIrisLeft$ = _
".............." + _
".............." + _
".............." + _
".............." + _
".............." + _
".XX....XX....." + _
".XX....XX....." + STRING$(7*14,".")
ghostIrisRight$ = _
".............." + _
".............." + _
".............." + _
".............." + _
".............." + _
".....XX....XX." + _
".....XX....XX." + STRING$(7*14,".")
'π π π πππ Main Program πππ π π π
SCREEN _NEWIMAGE(300,100,12)
_ALERT("Click/touch the screen to pause the program.")
loopCount% = 1
βanother_ghost:
IF loopCount% MOD 3 = 0 THEN _
π»PrintGhost( _
INT(RND*(100)), _
INT(RND*(_HEIGHT-ghostHeight%)) )
_DELAY 0.025
IF _MOUSEBUTTON THEN WHILE _MOUSEBUTTON : WEND
SCROLL 1,0,FALSE
loopCount% += 1
GOTO βanother_ghost
END
'π π π Subroutines π π π
SUB π»PrintGhost(x%,y%)
bodyColor% = INT(RND*14)+1
eyeDirection% = INT(RND*2)
ghostEyeball$ = IFF(eyeDirection%,ghostEyeballLeft$,ghostEyeballRight$)
ghostIris$ = IFF(eyeDirection%,ghostIrisLeft$,ghostIrisRight$)
irisColor% = IFF(INT(RND*2), 1, 6)
FOR thisY = 1 TO ghostHeight%
FOR thisX = 1 TO ghostWidth%
IF MID$(ghostBod$, (thisY-1) * ghostWidth% + thisX, 1) <> "." THEN PSET (x% + thisX - 1, y% + thisY - 1), bodyColor%
IF MID$(ghostEyeball$, (thisY-1) * ghostWidth% + thisX, 1) <> "." THEN PSET (x% + thisX - 1, y% + thisY - 1), 15
IF MID$(ghostIris$, (thisY-1) * ghostWidth% + thisX, 1) <> "." THEN PSET (x% + thisX - 1, y% + thisY - 1), irisColor%
NEXT thisX
NEXT thisY
END SUB